<template>
    <div  id="coverTable" ref="coverTable" v-if="constant.isShow" v-loading="loading">
        <!-- 查询页面 -->
            <el-form :model="form">
                <el-form-item >
                        <el-select  v-model="form.nurse" :value-key="getMapKey(form.nurse)" @change="nurseChoose" style="width: 200px; margin-right:10px;">
                            <el-option  v-for="item in cache.nurseData" :key="getMapKey(item)"  :value="item" :label="getMapValue(item)"></el-option>
                        </el-select>
                        <el-select v-model="form.region" placeholder="请选择类型" ref="coverTableSelect" @change="providerTypeChoose" style="margin-right:10px;">
                            <el-option :label="selector.label.allLinkProviderList" value="allLinkProviderList"></el-option>
                            <el-option :label="selector.label.thisTimeComedList" value="thisTimeComedList"></el-option>
                            <el-option :label="selector.label.nowZcPList" value="nowZcPList"></el-option>
                            <el-option :label="selector.label.fusuPList" value="fusuPList"></el-option>
                            <el-option :label="selector.label.thisTimeCreateList" value="thisTimeCreateList"></el-option>
                            <el-option :label="selector.label.rCardPList" value="rCardPList"></el-option>
                            <el-option :label="selector.label.currentTimeNotComedPList" value="currentTimeNotComedPList"></el-option>
                            <el-option :label="selector.label.xiuMianPList" value="xiuMianPList"></el-option>
                            <el-option :label="selector.label.liuShiPList" value="liuShiPList"></el-option>
                            <el-option :label="selector.label.hasFiveLinkPList" value="hasFiveLinkPList"></el-option>
                            <el-option :label="selector.label.createButNotConnPList" value="createButNotConnPList"></el-option>
                        </el-select>
                        <el-select  v-model="form.village" value-key="splitAddress"  @change="villageChoose" style="width: 200px;margin-right:10px;">
                            <el-option  v-for="item in cache.villageData" :key="item.splitAddress"  :value="item" :label="item.villCountDesc"></el-option>
                        </el-select>
                        <el-button type="primary"  @click="searchButtonEvent"  style="">查询</el-button>
                </el-form-item>
                <el-form-item>
                    <h1>{{h1Tip}}</h1>
                </el-form-item>


            </el-form>
        <!-- table top -->
            <table id ="thisTown" alias="top" data-toggle="table" class="table table-striped">
            </table>
            <div :height="outHeight">
             <table id = "table"  alias="content" data-toggle="table" class="table table-striped" >                
            </table>
            </div>
        <!-- table content -->
    </div>
</template>
<script>
//import '../../../../assets/styles/tableRound.css';
import '../../../../assets/styles/pagination.css';
import '../../../../assets/styles/button.css';
import '../../../../assets/styles/bootstrap-table.css';

import bloodSourcesHttp from 'plugins/axios/bloodSourcesHttp.js';
import api from 'plugins/axios/api.js';
import analysisHttp from 'plugins/axios/analysisHttp.js';

export default {
    data(){
        return{
            loading:true,
            topTable:null,
            contentTable:null,
            h1Tip:null,
            nurseName:null,
            providerTypeName:null,
            villageName:null,
            topTableData:[],
            contentTableData:[],
            constant:{
                isShow:true,
                isloading:true
            },
            cache:{
                nurseData:[],
                providerTypeData:[],
                villageData:[],
                totalTypeAndVillageData:{}
            },
            form:{
                region:{},
                nurse:{},
                village:{}, 
            },
            selector:{
                label:{
                    allLinkProviderList:null,
                    xiuMianPList:null,
                    fusuPList:null,
                    thisTimeComedList:null,
                    thisTimeCreateList:null,
                    nowZcPList:null,
                    currentTimeNotComedPList:null,
                    liuShiPList:null,
                    createButNotConnPList:null,
                    rCardPList:null,
                    hasFiveLinkPList:null
                }
            },
            tableData:{
                rowsData:[],
            }
        }
    },
    created(){
        window.self = this;
    },
    mounted(){
       let self = this;
       self.init(); 
    },
    props:[],
    watch:{},
    components:{},
    computed:{
        outHeight(){//外部表格高度
            return this.$store.state.clientHeight-184;
        },
        //内部dialog(弹窗内部)表格高度
        innerTableHeight(){
            return this.$store.state.clientHeight-280;
        }
    },
    methods:{
        /**
         * 获取当前轮次
        */
        getRoundAjax(callback){
            //动态获取后台轮次
            //获取相关后台数据，根据前台所传Id
            analysisHttp.getRoundAjax().then(res=>{
                callback(res.content);
        });       
        },
        //获取map里面的key值
        getMapKey(map){
            for(var p in map){
                return p;
                break;
            }
        },
        //获取map里面的Value值
        getMapValue(map){
            for(var p in map){
                return map[p];
                break;
            }
        },
        //选择护士
        nurseChoose(){
            let self = this;
            self.nurseName=self.getMapValue(self.form.nurse);
            self.initProviderType();
        },
        //选择浆员类型
        providerTypeChoose(){
            let self = this;
            self.matcherVillageType();
        },
        //村落选择
        villageChoose(){
            let self = this;
            self.villageName = self.form.village.villCountDesc;
            self.syschShowInfo();
        },
        //同步显示h1标签tip信息
        syschShowInfo(){
            let self = this;
            self.h1Tip = self.nurseName+"-"+self.providerTypeName+"-"+self.villageName;
        },
        //匹配相关村落类型数据
        matcherVillageType(){
            let self =  this;
            //self.form.region = 浆员类型下拉框选中的对应值
            switch(self.form.region){
                case 'allLinkProviderList':
                            self.cache.villageData= self.cache.totalTypeAndVillageData.allLinkProviderList.villList;      
                            self.form.village = self.cache.villageData[0];
                            self.providerTypeName = self.cache.totalTypeAndVillageData.allLinkProviderList.typeDesc;
                            break;
                case 'xiuMianPList':self.cache.villageData= self.cache.totalTypeAndVillageData.xiuMianPList.villList;
                            self.form.village = self.cache.villageData[0];
                            self.providerTypeName = self.cache.totalTypeAndVillageData.xiuMianPList.typeDesc;
                            break;
                case 'fusuPList':
                    self.cache.villageData= self.cache.totalTypeAndVillageData.fusuPList.villList;        
                            self.providerTypeName = self.cache.totalTypeAndVillageData.fusuPList.typeDesc;
                            self.form.village = self.cache.villageData[0];break;

                case 'thisTimeComedList':
                    self.cache.villageData= self.cache.totalTypeAndVillageData.thisTimeComedList.villList ;   
                            self.providerTypeName = self.cache.totalTypeAndVillageData.thisTimeComedList.typeDesc;
                            self.form.village = self.cache.villageData[0];break;

                case 'thisTimeCreateList':
                    self.cache.villageData= self.cache.totalTypeAndVillageData.thisTimeCreateList.villList;        
                            self.providerTypeName = self.cache.totalTypeAndVillageData.thisTimeCreateList.typeDesc;
                            self.form.village = self.cache.villageData[0];break;

                case 'nowZcPList':
                    self.cache.villageData= self.cache.totalTypeAndVillageData.nowZcPList.villList;         
                            self.providerTypeName = self.cache.totalTypeAndVillageData.nowZcPList.typeDesc;
                            self.form.village = self.cache.villageData[0];break;

                case 'currentTimeNotComedPList':
                    self.cache.villageData= self.cache.totalTypeAndVillageData.currentTimeNotComedPList.villList;    
                            self.providerTypeName = self.cache.totalTypeAndVillageData.currentTimeNotComedPList.typeDesc;
                            self.form.village = self.cache.villageData[0];break;

                case 'liuShiPList':
                    self.cache.villageData= self.cache.totalTypeAndVillageData.liuShiPList.villList;       
                            self.providerTypeName = self.cache.totalTypeAndVillageData.liuShiPList.typeDesc;
                            self.form.village = self.cache.villageData[0];break;

                case 'createButNotConnPList':
                    self.cache.villageData= self.cache.totalTypeAndVillageData.createButNotConnPList.villList;     
                            self.providerTypeName = self.cache.totalTypeAndVillageData.createButNotConnPList.typeDesc;
                            self.form.village = self.cache.villageData[0];break;

                case 'rCardPList':
                    self.cache.villageData= self.cache.totalTypeAndVillageData.rCardPList.villList;          
                            self.providerTypeName = self.cache.totalTypeAndVillageData.rCardPList.typeDesc;
                            self.form.village = self.cache.villageData[0];break;

                case 'hasFiveLinkPList':
                    self.cache.villageData= self.cache.totalTypeAndVillageData.hasFiveLinkPList.villList;     
                            self.providerTypeName = self.cache.totalTypeAndVillageData.hasFiveLinkPList.typeDesc;
                            self.form.village = self.cache.villageData[0];break;

            }
            self.syschShowInfo();
        },
        //初始化数据
        init(){
            let self = this;
            self.initCache();
        },
        //初始化缓存
        initCache(){
            let self = this;
            self.loadNurseLinkProviderStatistics();
        },
        //初始化页面表格
        initTable(){
            let self = this;
            self.queryTopTableData();
            self.queryContentTableData();
        },
        //初始化TOP表格
        initTopTable(){
            let self = this;
            let bodyclientH = document.body.clientHeight;
            $("#thisTown").bootstrapTable('destroy').bootstrapTable({ 
                    striped:true,
                    undefinedText: "/", 
                    data:self.topTableData,
                    columns: [
                                {
                                    width: name === "今天所有村落浆员" ? "2.3%" : "",
                                    title: name === "今天所有村落浆员" ? '序号' : "序号",
                                    field: "",
                                    sortable: name === "今天所有村落浆员" ? true : false
                                },
                                {
                                    width: name === "今天所有村落浆员" ? "8%" : "",
                                    title: name === "今天所有村落浆员" ? '村名' : "",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    field:"villageName"
                                },
                                {
                                    field: "",
                                    title: '重点管理村',
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%"
                                },
                                {
                                    field: 'allProviderNum',
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    title: '注册浆员总人数'
                                },
                                {
                                    field: 'lastYearCollNum',
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    title: '去年浆量/袋'
                                },
                                {
                                    field: 'currentTimePNum',
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    title: '当期进站人数'
                                },
                                {
                                    field: "lastTimePNum",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    align: "center",
                                    title: '同期进站人数'
                                },
                                {
                                    field: 'currentTimeCollNum',
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    title: '当期浆量/袋'
                                },
                                {
                                    field: 'lastTimeCollNum',
                                    title: '同期浆量/袋',
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    align: "center",
                                    sortable: name === "今天所有村落浆员" ? true : false
                                },
                                {
                                    field: 'collNumDiff',
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    title: '当期与同期浆量差/袋'
                                },
                                {
                                    field: 'currentTimeAddPNum',
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    title: '当期新增人数'
                                },
                                {
                                    field: 'lastTimeAddPNum',
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    align: "center",
                                    title: '同期新增人数'
                                },
                                {
                                    title: "新增浆员当期与同期差/人",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "addNumDiff"
                                },
                                {
                                    field: 'currentTimeAddCollNum',
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    title: '当期新增浆量/袋'
                                },
                                {
                                    title: "同期新增浆量/袋",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "lastTimeAddCollNum"
                                },
                                {
                                    title: "当期复苏浆员总人数",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "currentTimeFuSuPNum"
                                },
                                {
                                    title: "当期复苏浆员浆量/袋",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "currentTimeFuSuCollNum"
                                },
                                {
                                    title: "忠诚浆员当期总人数",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "currentTimeZCPNum"
                                },
                                {
                                    title: "忠诚浆员同期总人数",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "lastTimeZCPNum"
                                },
                                {
                                    title: "忠诚浆员当期浆量/袋",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "currentTimeZCCollNum"
                                },
                                {
                                    title: "忠诚浆员同期浆量/袋",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "lastTimeZCCollNum"
                                },
                                {
                                    title: "忠诚浆员浆量当期与同期差/袋",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "zcCollNumDiff"
                                },
                                {
                                    title: "忠诚浆员去年浆量/袋",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "lastYearZCCollNum"
                                },
                                {
                                    title: "当期未进站总人数",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    field: "currentTimeNotComedPNum"
                                },
                                {
                                    title: "当期未进站总人数去年浆量/袋",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.56%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "currentTimeNotComedPLastYearCollNum"
                                },
                                {
                                    title: "休眠浆员总人数",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "xiuMianPNum"
                                },
                                {
                                    title: "休眠浆员去年浆量/袋",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "lastYearXiuMianCollNum"
                                },
                                {
                                    title: "休眠浆员同期浆量/袋",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "lastTimeXiuMianCollNum"
                                },
                                {
                                    title: "流失浆员总人数",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "liuShiPNum"
                                },
                                {
                                    title: "进站未链接浆员人数",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "comedNotConnPNum"
                                },
                                {
                                    title: "进站未链接浆员当期浆量/袋",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "comedNotConnThisTimeCollNum"
                                },
                                {
                                    title: "进站未链接浆员同期浆量/袋",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "comedNotConnLastTimeCollNum"
                                },
                                {
                                    title: "进站未链接浆员去年浆量/袋",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "comedNotConnLastYearCollNum"
                                    
                                },
                                {
                                    title: "已链接休眠的浆员人数",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "connXMPNum"
                                
                                },
                                {
                                    title: "已链接休眠的浆员同期浆量/袋",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "lastTimeConnXMCollNum"
                                
                                },
                                {
                                    title: "未链接休眠的浆员人数",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "notConnXMPNum"
                                    
                                },
                                {
                                    title: "未链接休眠的浆员同期浆量/袋",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "lastTimeNotConnXMCollNum"
                                    
                                },
                                {
                                    title: "管理护士总人数",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "connNurseNum"
                                    
                                },
                                {
                                    title: "已链接浆员总人数",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "connedPNum"
                                    

                                },
                                {
                                    title: "义工总人数",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "volunteerNum"
                                },
                                {
                                    title: "义工管理浆员总人数",
                                    width: name === "今天所有村落浆员" ? "2.3%" : "2.57%",
                                    sortable: name === "今天所有村落浆员" ? true : false,
                                    align: "center",
                                    field: "volunConnGJZNum"
                                

                                }
                            ]
                   
             });
        },
        //初始化CONTENT表格
        initContentTable(){
            let self = this;
            let bodyclientH = document.body.clientHeight;
                $("#table").bootstrapTable('destroy').bootstrapTable({
                    cache: false,
                    height: (name === "今天所有村落浆员") ? ((bodyclientH - 70 - $("#coverTable>h1").height()) / 2) : ( bodyclientH - 80 - $("#thisTown").height() - $("#coverTable>h1").height()),
                    undefinedText: "",
                    pagination:true,
                    pageList:[5,10,15,20],
                    search: true,
                    striped:true,
                    align: "center",
                    sortName: "times",
                    data:self.contentTableData,
                    onPostHeader: function () {
                        //标记轮次
                        self.getRoundAjax(function (item) {
                            $("th[data-field=round" + item.roundIdx + "]").css("background", "rgb(54, 142, 78)");
                        });
                    },
                    onPostBody: function () {
                        //添加class pulp-name-class
                        $('.pulp-name-class').on('dblclick', function () {
                            $(this).parents('tr').find(".pulp-name").addClass($(this).data("row"));
                        }).trigger('dblclick');
                    },
                    columns: [

                                    {
                                        width: "2%",
                                        class: "",
                                        title: '序号',
                                        sortable: true,
                                        align: "center",
                                        formatter: function (value, row, index) {
                                            return index + 1;
                                        }
                                    },
                                    {
                                        field: "cardId",
                                        title: '卡号',
                                        class: "",
                                        sortable: true,
                                        align: "center",
                                        width: "4%"
                                    },
                                    {
                                        field: 'name',
                                        width: "4%",
                                        class: "pulp-name",
                                        sortable: true,
                                        align: "center",
                                        title: '姓名',
                                    },
                                    {
                                        field: "villId",
                                        class: "",
                                        width: "4%",
                                        sortable: true,
                                        align: "center",
                                        title: '重点浆员类型'
                                    },
                                    {
                                        field: 'age',
                                        class: "",
                                        sortable: true,
                                        width: "2%",
                                        align: "center",
                                        title: '年龄'
                                    },
                                    {
                                        field: 'gender',
                                        title: '性别',
                                        sortable: true,
                                        class: "",
                                        align: "center",
                                        width: "2%",
                                    },
                                    {
                                        field: 'pulpAge',
                                        width: "2%",
                                        class: "",
                                        align: "center",
                                        sortable: true,
                                        title: '浆龄'
                                    },
                                    {
                                        field: 'currentYearAllCollNum',
                                        width: "2%",
                                        sortable: true,
                                        align: "center",
                                        title: '今年当期总次数',
                                        class: "bg_2f9",
                                    },
                                    {
                                        field: 'lastYearCurrentTimeCollNum',
                                        class: "bg_2f9",
                                        sortable: true,
                                        width: "3%",
                                        align: "center",
                                        title: '去年同期总次数'
                                    },
                                    {
                                        field: 'lastYearAllCollNum',
                                        sortable: true,
                                        width: "3%",
                                        class: "bg_2f9",
                                        align: "center",
                                        title: '去年献浆总次数',
                                    },
                                    {
                                        title: "献浆总次数",
                                        sortable: true,
                                        class: "bg_2f9",
                                        width: "3%",
                                        align: "center",
                                        field: "allCollNum",
                                    },
                                    // {
                                    //     title: "献浆员类型",
                                    //     class: "",
                                    //     sortable: true,
                                    //     width: "3%",
                                    //     field: "gjzType"
                                    // },
                                    {
                                        title: "管理护士姓名",
                                        class: "",
                                        sortable: true,
                                        width: "4%",
                                        align:"center",
                                        field: "manageNurse"
                                    },
                                    {
                                        title: "管理义工姓名",
                                        class: "round-volunteer",
                                        width: "4%",
                                        sortable: true,
                                        field: "yiGong",
                                        align:"center",
                                        formatter: function (value, row, index) {
                                            var html = "<div class='cursor' ><span data-yigongid='" + (row.yiGongId ? row.yiGongId : "") + "'>" + (row.yiGong ? row.yiGong : "") + "</span><span onclick='openVolunteer(this,\"" + row.providerNo + "\")' class='placehold-communication cursor' ></span></div>";
                                            return html;
                                        }
                                    },
                                    {
                                        title: "介绍人姓名",
                                        class: "",
                                        width: "4%",
                                        sortable: true,
                                        align:"center",
                                        field: "introducer"
                                    },
                                    {
                                        title: "最新沟通内容",
                                        class: "",
                                        width: "5%",
                                        sortable: true,
                                        align:"center",
                                        field: "communResult",
                                        formatter: function (value, row, index) {
                                            var html = "<div " + (value ? "onmouseover='mouseoverToast(this,\"" + value + "\")'" : "") + "'><span class='cursor' style='width: 100%;display: inline-block;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;' onclick='" + ( row.communResult ? "openNotPulpCommunication(\"" + row.providerNo + "\")" : "") + "'>" + (value ? (value.length > 5 ? (value.substr(0, 5) + "...") : value) : "") + "</span><span class='placehold-communication'></span></div>";
                                            return html;
                                        }
                                    },
                                    {
                                        title: "详细地址",
                                        class: "",
                                        width: "8%",
                                        sortable: true,
                                        align:"center",
                                        field: "detailVillage"
                                    },
                                    {
                                        title: "1",
                                        class: "roundID",
                                        field: "row.allRound[1].round1",
                                        align: "center",
                                        sortable: true,
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round1, row, index, row.allRound[0].round1, row.allRound[1].round1);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round1, row, index, row.lastYearRound.round1, row.currentYearRound.round1);
                                            }
                                            
                                        }
                                    },
                                    {
                                        title: "2",
                                        class: "roundID",
                                        sortable: true,
                                        align:"center",
                                        field: "row.allRound[1].round2",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round2, row, index, row.allRound[0].round2, row.allRound[1].round2);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round2, row, index, row.lastYearRound.round2, row.currentYearRound.round2);
                                            }
                                            
                                        }
                                    },
                                    {
                                        title: "3",
                                        class: "roundID",
                                        sortable: true,
                                        align:"center",
                                        field: "row.allRound[1].round3",
                                    formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round3, row, index, row.allRound[0].round3, row.allRound[1].round3);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round3, row, index, row.lastYearRound.round3, row.currentYearRound.round3);
                                            }
                                            
                                        }
                                    },
                                    {
                                        title: "4",
                                        class: "roundID",
                                        sortable: true,
                                        align:"center",
                                        field: "row.allRound[1].round4",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round4, row, index, row.allRound[0].round4, row.allRound[1].round4);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round4, row, index, row.lastYearRound.round4, row.currentYearRound.round4);
                                            }
                                            
                                        }
                                    },
                                    {
                                        title: "5",
                                        class: "roundID",
                                        sortable: true,
                                        align:"center",
                                        field: "row.allRound[1].round5",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round5, row, index, row.allRound[0].round5, row.allRound[1].round5);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round5, row, index, row.lastYearRound.round5, row.currentYearRound.round5);
                                            }
                                            
                                        }
                                    },
                                    {
                                        title: "6",
                                        class: "roundID",
                                        field: "row.allRound[1].round6",
                                        sortable: true,
                                        align:"center",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round6, row, index, row.allRound[0].round6, row.allRound[1].round6);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round6, row, index, row.lastYearRound.round6, row.currentYearRound.round6);
                                            }
                                            
                                        }
                                    },
                                    {
                                        title: "7",
                                        class: "roundID",
                                        field: "row.allRound[1].round7",
                                        sortable: true,
                                        align:"center",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round7, row, index, row.allRound[0].round7, row.allRound[1].round7);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round7, row, index, row.lastYearRound.round7, row.currentYearRound.round7);
                                            }
                                            
                                        }
                                    },
                                    {
                                        title: "8",
                                        class: "roundID",
                                        field: "row.allRound[1].round8",
                                        sortable: true,
                                        align:"center",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round8, row, index, row.allRound[0].round8, row.allRound[1].round8);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round8, row, index, row.lastYearRound.round8, row.currentYearRound.round8);
                                            }
                                            
                                        }
                                    },
                                    {
                                        title: "9",
                                        class: "roundID",
                                        field: "row.allRound[1].round9",
                                        sortable: true,
                                        align:"center",
                                    formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round9, row, index, row.allRound[0].round9, row.allRound[1].round9);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round9, row, index, row.lastYearRound.round9, row.currentYearRound.round9);
                                            }
                                            
                                        }
                                    },
                                    {
                                        title: "10",
                                        class: "roundID",
                                        field: "row.allRound[1].round10",
                                        align: "center",
                                        sortable: true,
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round10, row, index, row.allRound[0].round10, row.allRound[1].round10);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round10, row, index, row.lastYearRound.round10, row.currentYearRound.round10);
                                            }
                                            
                                        }
                                    },
                                    {
                                        title: "11",
                                        class: "roundID",
                                        sortable: true,
                                        align:"center",
                                        field: "row.allRound[1].round11",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round11, row, index, row.allRound[0].round11, row.allRound[1].round11);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round11, row, index, row.lastYearRound.round11, row.currentYearRound.round11);
                                            }
                                            
                                        }
                                    },
                                    {
                                        title: "12",
                                        class: "roundID",
                                        sortable: true,
                                        align:"center",
                                        field: "row.allRound[1].round12",
                                    formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round12, row, index, row.allRound[0].round12, row.allRound[1].round12);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round12, row, index, row.lastYearRound.round12, row.currentYearRound.round12);
                                            }
                                            
                                        }
                                    },
                                    {
                                        title: "13",
                                        class: "roundID",
                                        field: "row.allRound[1].round13",
                                        align: "center",
                                        sortable: true,
                                    
                                    formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round13, row, index, row.allRound[0].round13, row.allRound[1].round13);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round13, row, index, row.lastYearRound.round13, row.currentYearRound.round13);
                                            }
                                            
                                        }
                                    },
                                    {
                                        title: "14",
                                        class: "roundID",
                                        sortable: true,
                                        align: "center",
                                        field: "row.allRound[1].round14",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round14, row, index, row.allRound[0].round14, row.allRound[1].round14);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round14, row, index, row.lastYearRound.round14, row.currentYearRound.round14);
                                            }
                                            
                                        }
                                    },
                                    {
                                        title: "15",
                                        class: "roundID",
                                        field: "row.allRound[1].round15",
                                        align: "center",
                                        sortable: true,
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round15, row, index, row.allRound[0].round15, row.allRound[1].round15);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round15, row, index, row.lastYearRound.round15, row.currentYearRound.round15);
                                            }                        
                                        }
                                    },
                                    {
                                        title: "16",
                                        class: "roundID",
                                        field: "row.allRound[1].round16",
                                        align: "center",
                                        sortable: true,
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round16, row, index, row.allRound[0].round16, row.allRound[1].round16);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round16, row, index, row.lastYearRound.round16, row.currentYearRound.round16);
                                            }                        
                                        }
                                    },
                                    {
                                        title: "17",
                                        class: "roundID",
                                        field: "row.allRound[1].round17",
                                        align: "center",
                                        sortable: true,
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round17, row, index, row.allRound[0].round17, row.allRound[1].round17);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round17, row, index, row.lastYearRound.round17, row.currentYearRound.round17);
                                            }                        
                                        }
                                    },
                                    {
                                        title: "18",
                                        class: "roundID",
                                        sortable: true,
                                        align: "center",
                                        field: "row.allRound[1].round18",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round18, row, index, row.allRound[0].round18, row.allRound[1].round18);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round18, row, index, row.lastYearRound.round18, row.currentYearRound.round18);
                                            }                        
                                        }

                                    },
                                    {
                                        title: "19",
                                        class: "roundID",
                                        field: "row.allRound[1].round19",
                                        align: "center",
                                        sortable: true,
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round19, row, index, row.allRound[0].round19, row.allRound[1].round19);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round19, row, index, row.lastYearRound.round19, row.currentYearRound.round19);
                                            }                        
                                        }

                                    },
                                    {
                                        title: "20",
                                        class: "roundID",
                                        sortable: true,
                                        align: "center",
                                        field: "row.allRound[1].round20",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round20, row, index, row.allRound[0].round20, row.allRound[1].round20);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round20, row, index, row.lastYearRound.round20, row.currentYearRound.round20);
                                            }                        
                                        }

                                    },
                                    {
                                        title: "21",
                                        class: "roundID",
                                        sortable: true,
                                        align: "center",
                                        field: "row.allRound[1].round21",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round21, row, index, row.allRound[0].round21, row.allRound[1].round21);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round21, row, index, row.lastYearRound.round21, row.currentYearRound.round21);
                                            }                        
                                        }
                                    },
                                    {
                                        title: "22",
                                        class: "roundID",
                                        sortable: true,
                                        align: "center",
                                        field: "row.allRound[1].round22",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round22, row, index, row.allRound[0].round22, row.allRound[1].round22);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round22, row, index, row.lastYearRound.round22, row.currentYearRound.round22);
                                            }                        
                                        }
                                    },
                                    {
                                        title: "23",
                                        class: "roundID",
                                        sortable: true,
                                        align: "center",
                                        field: "row.allRound[1].round23",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round23, row, index, row.allRound[0].round23, row.allRound[1].round23);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round23, row, index, row.lastYearRound.round23, row.currentYearRound.round23);
                                            }                        
                                        }

                                    },
                                    {
                                        title: "24",
                                        class: "roundID",
                                        sortable: true,
                                        align: "center",
                                        field: "row.allRound[1].round24",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round24, row, index, row.allRound[0].round24, row.allRound[1].round24);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round24, row, index, row.lastYearRound.round24, row.currentYearRound.round24);
                                            }                        
                                        }

                                    },
                                    {
                                        title: "25",
                                        class: "roundID",
                                        sortable: true,
                                        align: "center",
                                        field: "row.allRound[1].round25",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round25, row, index, row.allRound[0].round25, row.allRound[1].round25);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round25, row, index, row.lastYearRound.round25, row.currentYearRound.round25);
                                            }                        
                                        }

                                    },
                                    {
                                        title: "26",
                                        class: "roundID",
                                        sortable: true,
                                        align: "center",
                                        field: "row.allRound[1].round26",
                                        formatter: function (value, row, index) {
                                            if(row.allRound!=null&&typeof (row.allRound) != "undefined"){
                                            return getRoundEle(row.allRound[1].round26, row, index, row.allRound[0].round26, row.allRound[1].round26);
                                            }else
                                            if(row.lastYearRound !=null && typeof(row.lastYearRound)!= "undefined"&& row.currentYearRound !=null&&  typeof (row.currentYearRound) != "undefined"){
                                            return getRoundEle(row.currentYearRound.round26, row, index, row.lastYearRound.round26, row.currentYearRound.round26);
                                            }                        
                                        }

                                    }
                                ]
                });
        },
        //初始化护士信息
        initNurse(){
            let self = this;
            //所有护士信息 此处依赖统计模块的查询所有护士接口，如果该处报错或护士信息未查询到，请核对统计模块后端接口是否启动
            analysisHttp.getLinkNursePCount().then(res=>{
                 self.cache.nurseData = res.content;
                 self.form.nurse= self.cache.nurseData[0];
                 self.nurseName=self.getMapValue(self.form.nurse);
                 self.initProviderType();
            });
        },
        //初始化浆员类型信息
        initProviderType(){
            let self = this;
            // /adscm/analysis/xyDevelopAnalysis/getLinkNurseAllTypeProvider
            //获取当前村落名
            let nurseId = Number(self.getMapKey(self.form.nurse));
            let param = {
                nurseId:nurseId
            };
            analysisHttp.getLinkNurseAllTypeProvider(param).then(res=>{
                self.cache.totalTypeAndVillageData =  res.content;
                self.cache.villageData= res.content.allLinkProviderList.villList;
                self.form.village = res.content.allLinkProviderList.villList[0];
                self.providerTypeName=res.content.allLinkProviderList.typeDesc;
                self.villageName= self.form.village.villCountDesc;
                self.form.region="allLinkProviderList";     
                self.selector.label.allLinkProviderList = res.content.allLinkProviderList.typeDesc;
                self.selector.label.xiuMianPList= res.content.xiuMianPList.typeDesc;
                self.selector.label.fusuPList = res.content.fusuPList.typeDesc;
                self.selector.label.thisTimeComedList = res.content.thisTimeComedList.typeDesc;
                self.selector.label.thisTimeCreateList = res.content.thisTimeCreateList.typeDesc;               
                self.selector.label.nowZcPList = res.content.nowZcPList.typeDesc;
                self.selector.label.currentTimeNotComedPList = res.content.currentTimeNotComedPList.typeDesc;
                self.selector.label.liuShiPList = res.content.liuShiPList.typeDesc;
                self.selector.label.createButNotConnPList = res.content.createButNotConnPList.typeDesc;
                self.selector.label.rCardPList = res.content.rCardPList.typeDesc;
                self.selector.label.hasFiveLinkPList = res.content.hasFiveLinkPList.typeDesc;
                self.syschShowInfo(); 
                self.initTable();
            }); 
        },
        //查询TOP表格数据
        queryTopTableData(){
            let self = this;
            // /adscm/analysis/xyDevelopAnalysis/getLinkNurseAllTypeProvider
            //获取当前村落名
            let nurseId = Number(self.getMapKey(self.form.nurse));
            let param = {
                nurseId:nurseId
            };
            analysisHttp.getLinkNurseStatistics(param).then(res=>{
                self.topTableData = [res.content];
                self.initTopTable();
            });
            
        },
        //查询CONTENT表格轮次信息
        queryContentTableData(){
            let self = this;
            // /adscm/analysis/xyDevelopAnalysis/getLinkNurseAllTypeProvider
            //获取当前村落名
            let nurseId = Number(self.getMapKey(self.form.nurse));
            let type = self.form.region;
            let villName = self.form.village.splitAddress;
            let param = {
                nurseId:nurseId,
                type:type,
                villName:villName
            };
            analysisHttp.getProviderRoundByCondition(param).then(res=>{
                console.log(res);
                self.contentTableData = res.content;
                self.initContentTable();
            });
        },
        //初始化村落信息
        initVillage(){},
        //查询
        searchButtonEvent(){
            let self = this;
            self.queryTopTableData();
            self.queryContentTableData();
        },
        //装载护士综合数据
        loadNurseLinkProviderStatistics(){
            let self = this;
            analysisHttp.loadNurseLinkProviderStatistics().then(res=>{
                self.loading=false;
                self.initNurse();
            });
        },
    }
}
/*
* mouseoverRoundToast
* 移动到上面显示小标题 轮次
* */
window.mouseoverRoundToast =  function(event, value) {
    var index = value.substr(0, 1);
     var   text = value.substr(value.indexOf(":") + 1);
     var date = value.substr(value.indexOf("2"), 10);
    if (event.parentNode.parentNode === event.parentNode.parentNode.parentNode.children[0]) {
        if (date.substr(0, 4) === "2018") {
            event.parentNode.querySelector(".placehold-communication").style.top = "20px";
        } else if (date.substr(0, 4) === "2017") {
            event.parentNode.querySelector(".placehold-communication").style.top = "20px";
        }
    } else {
        if (date.substr(0, 4) === "2018") {
            event.parentNode.querySelector(".placehold-communication").style.top = "-20px";
        } else if (date.substr(0, 4) === "2017") {
            
            event.parentNode.querySelector(".placehold-communication").style.top = "-20px";
        }
    }

    if (date.substr(5, 2) === "12" && text.length > 10) {
        event.parentNode.querySelector(".placehold-communication").style.left = "-63px";
    } else if (date.substr(5, 2) === "12" && text.length === 10) {
        event.parentNode.querySelector(".placehold-communication").style.left = "-65px";
    } else if (date.substr(5, 2) !== "12" && text.length > 10) {
        event.parentNode.querySelector(".placehold-communication").style.left = "-45px";
    } else if (date.substr(5, 2) !== "12" && text.length === 10) {
        event.parentNode.querySelector(".placehold-communication").style.top = "1px";
        event.parentNode.querySelector(".placehold-communication").style.left = "-100px";
    }

    event.parentNode.querySelector(".placehold-communication").style.width = text.length > 10 ? "130px" : "90px";
    event.parentNode.querySelector(".placehold-communication").style.display = "block";
    event.parentNode.querySelector(".placehold-communication").innerText = text;
}
window.mouseoutRoundToast = function(event) {
    event.parentNode.querySelector(".placehold-communication").style.display = "none";
    event.parentNode.querySelector(".placehold-communication").innerText = "";
}
/*
* openUnqualifiedAndNoPulp
* 打开不合格浆员
* */
window.openUnqualifiedAndNoPulp = function(date, event, cardID) {
    //打开不合格浆员
    $("#popup").css({
        display: "block",
        width: "800px"
    });
    GetSameDayInAllPulp(date, event);
    autoCenter($("#popup"));
    getUnqualifiedAndNoPulp(date, cardID, function (item) {
        initUnqualifiedAndNoPulp(item);
    });
}
/*
* openStep5Link
* 打开五步链接
* */
window.openStep5Link  =function(date, event, cardID) {
    $("#popup1").css({
        display: "block",
        width: "800px"
    });
    autoCenter($("#popup1"));
    GetSameDayInAllPulp(date, event);
    getStep5LinkDetail(date, cardID, function (item) {
        initStep5LinkPopup(item);
    });
}

/*
* openClinicalResponse
* 打开临床反应
* */
window.openClinicalResponse =function(date, event, cardID) {
    $("#popup").css({
        display: "block",
        width: "800px"
    });
    GetSameDayInAllPulp(date, event);//圈出同一天的人员
    autoCenter($("#popup"));
    getClinicalDetail(date, cardID, function (item) {
        initClinicalPopup(item);
    });
}
/*
* autoCenter
* 自动居中对话框
* */
window.autoCenter = function(el) {
    var bodyW = $(window).width();
    var bodyH = $(window).height();
    var elW = el.width();
    var elH = el.height();
    el.css({"left": (bodyW - elW) / 2 + 'px', "top": (bodyH - elH) / 2 + 'px'});
}
/*
* GetSameDayInAllPulp
* 圈出同一天献浆的人
* */
var lastDate = "123";
var lastBgColor = "red";
var shareTitle= null;
window.GetSameDayInAllPulp =function(date, event) {
    $("#table .pulp-name-class.active").css("background", lastBgColor).removeClass("active");
    lastBgColor = event.style.background;
    event.className = "pulp-name-class active";
    event.style.background = "rgba(212, 53, 27, 0.6)";

    $("#table ." + lastDate).css("background", "");
    $("#table ." + lastDate).css("color", "");
    $("#table .pulp" + date).css("background", "rgba(212, 53, 27, 0.6)");
    $("#table .pulp" + date).css("color", "white");

    var length = document.querySelectorAll("#table .pulp" + date).length;
    var title;
    if(shareTitle==null){
        shareTitle  = $("h1").text();
    }
    //  title = shareTitle+"  日期\n"+date + "（" + length + " 人）";
    //  $("h1").text(title); 
     lastDate = "pulp" + date;
}

 /*
   * getRoundEle
   * 轮次表格的元素生成
   * */
window.getRoundEle = function(value, row, index, lr, r) {
     var html = "<i " +
        "" + (lr.substr(0, 1) === "0" ? "" : "onmouseover='mouseoverRoundToast(this,\"" + lr + "\")'") + " " +
        "" + (lr.substr(0, 1) !== "0" ? "onmouseout='mouseoutRoundToast(this)'" : "" ) + " " +
        "" + (lr.substr(0, 1) === "5" ? "onclick='openUnqualifiedAndNoPulp(\"" + lr.substr(2, 10) + "\",this,\"" + row.cardId + "\")'" :
            "" + (lr.substr(0, 1) === "4" ? "onclick='openStep5AndClinical(\"" + lr.substr(2, 10) + "\",this,\"" + row.cardId + "\")'" :
            (lr.substr(0, 1) === "3" ? "onclick='openStep5Link(\"" + lr.substr(2, 10) + "\",this,\"" + row.cardId + "\")'" :
                (lr.substr(0, 1) === "2" ? "onclick='openClinicalResponse(\"" + lr.substr(2, 10) + "\",this,\"" + row.cardId + "\")'" :
                    (lr.substr(0, 1) === "1" ? "onclick='GetSameDayInAllPulp(\"" + lr.substr(2, 10) + "\",this)'" : ""))))) + " " +
        "" + (lr.substr(0, 1) === "1" ? "style='background: #03E590'" : ((lr.substr(0, 1) === "2" || lr.substr(0, 1) === "4") ? "style='background: red'" : (lr.substr(0, 1) === "3" ? "style='background: #F8AC2C'" : (lr.substr(0, 1) === "5" ? "style='background: #cc02ff'" : "")))) + " data-index='" + value.substr(0, 1) + "' data-row='" + madeClassDate(row) + "' class='pulp-name-class' ></i>" +
        "<i " +
        "" + (r.substr(0, 1) === "0" ? "" : "onmouseover='mouseoverRoundToast(this,\"" + r + "\")'") + " " +
        "" + (r.substr(0, 1) !== "0" ? "onmouseout='mouseoutRoundToast(this)'" : "" ) + " " +
        "" + (r.substr(0, 1) === "5" ? "onclick='openUnqualifiedAndNoPulp(\"" + r.substr(2, 10) + "\",this,\"" + row.cardId + "\")'" :
            "" + (r.substr(0, 1) === "4" ? "onclick='openStep5AndClinical(\"" + r.substr(2, 10) + "\",this,\"" + row.cardId + "\")'" :
            (r.substr(0, 1) === "3" ? "onclick='openStep5Link(\"" + r.substr(2, 10) + "\",this,\"" + row.cardId + "\")'" :
                (r.substr(0, 1) === "2" ? "onclick='openClinicalResponse(\"" + r.substr(2, 10) + "\",this,\"" + row.cardId + "\")'" :
                    (r.substr(0, 1) === "1" ? "onclick='GetSameDayInAllPulp(\"" + r.substr(2, 10) + "\",this)'" : ""))))) + " " +
        "" + (r.substr(0, 1) === "1" ? "style='background: #06B7E5'" : ((r.substr(0, 1) === "2" || r.substr(0, 1) === "4") ? "style='background: red'" : ((r.substr(0, 1) === "3" ? "style='background: #F8AC2C'" : (r.substr(0, 1) === "5" ? "style='background: #cc02ff'" : ""))))) + "  class='pulp-name-class' ></i>" +
        "<span class='placehold-communication cursor' style='left:-30px;'></span>";
    return html;
    }

</script>
<style>
.el-form{
    margin-bottom: 60px;
}
.pull-right {
    float: right;
    position: absolute!important;
    top: 120px;
    right: 40px;
}


    .cursor{
      cursor:pointer;
    }
    .cursor:hover{
      color:floralwhite;
      background-color:#436EEE;
    }
.table td > .placehold-communication,
.table td > div > .placehold-communication {
    display: none;
    width: 90px;
    position: absolute;
    left: 0px;
    top: 24px;
    color: #000;
    font-size: 13px;
    border: 1px solid rgba(51, 51, 51, 0.33);
    padding: 5px;
    line-height: 16px;
    background: #FFF;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-box-shadow: 0px 0px 15px 1px rgba(0, 0, 0, .55);
    -moz-box-shadow: 0px 0px 15px 1px rgba(0, 0, 0, .55);
    box-shadow: 0px 0px 15px 1px rgba(0, 0, 0, 0.55);
    border-radius: 7px;
    -webkit-border-radius: 7px;
    -moz-border-radius: 7px;
    z-index: 99999;
    
}
.pulp-name-class{
    width:100%;
    height:13px;
    display:block;
    cursor:pointer;
    margin-bottom:2px;
}
.el-dialog__body{
    color:black !important;
}
.select_type_class{
    position: absolute;
    left:40%;
    top:5px;
    z-index:999;
}
.fixed-table-body {
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
}
</style>